﻿using System;
using System.Collections;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Xml.Linq;
using System.IO;

using CommonUtils;
using TDAL = EzDAL.Auto2;
using TDALUtils = EzDAL.Utils;
using TConst = TERP.Constants;
using TUtils = TERP.Utils;
using TError = TERP.Errors;
using TBiz = TERP.BizITS;


[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class WSITS : System.Web.Services.WebService
{
	#region // Constructors and Destructors:
    private TBiz.BizWater _biz = null;
	private DataSet _mdsInitError = null;

    public WSITS()
	{
		try
		{
			//Uncomment the following line if using designed components 
			//InitializeComponent();

			// Myinit:
			// Note that: the CConfig will auto load because it has static constructor.
			LoadConfig();
		}
		catch (Exception exc)
		{
			_mdsInitError = CMyDataSet.NewMyDataSet();
			CMyDataSet.SetErrorCode(ref _mdsInitError, TError.ErrITS.CommonServiceInit);
			CMyDataSet.AppendErrorParams(
				ref _mdsInitError
				, "Exception.Message", exc.Message
				, "Exception.StackTrace", exc.StackTrace
				);
			_mdsInitError.AcceptChanges();
		}
	}
	private void LoadConfig()
	{
        _biz = new TBiz.BizWater();
        _biz.LoadConfig(new object[] {
				"_strConfig_Log_Url", ConfigurationManager.AppSettings["_strConfig_Log_Url"]

				, "_strConfig_DBConnStr_CarSv", ConfigurationManager.AppSettings["_strConfig_DBConnStr_CarSv"]

				, "_strConfig_GWUserCode", ConfigurationManager.AppSettings["_strConfig_GWUserCode_CarSv"]
				, "_strConfig_GWUserPassword", ConfigurationManager.AppSettings["_strConfig_GWUserPassword_CarSv"]
				, "_strConfig_GwUserPasswordForLog", ConfigurationManager.AppSettings["_strConfig_GwUserPasswordForLog_CarSv"]
			});
	}
	#endregion

	#region // Common:
	[WebMethod]
	public DataSet CommonGetMixItem(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strPartnerCode
			, string strPartnerUserCode
			, string strLanguageCode
			, string strMixCode
			, object[] arrobjParamsCouple
		)
	{
		// Temp:
		string strFunctionName = "CommonGetMixItem";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});

		try
		{
			// CheckGatewayAuthentication:
			CConfig.s_cmManager.CheckGatewayAuthentication(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.CommonGetMixItem(
			strGWUserCode // strGWUserCode
			, strGWPassword // strGWPassword
			, strTid // strTid
			, strPartnerCode // strPartnerCode
			, strPartnerUserCode // strPartnerUserCode
			, strLanguageCode // strLanguageCode
			, strMixCode // strMixCode
			, arrobjParamsCouple // arrobjParamsCouple
			));
	}

	[WebMethod]
	public DataSet CommonSignIn(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strPartnerCode
			, string strPartnerUserCode
			, string strLanguageCode
			, string strDealerCode
			, string strNickName
			, string strPassword
			, string strOtherInfo
		)
	{
		// Temp:
		string strFunctionName = "CommonSignIn";

		//#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});

		try
		{
			// CheckGatewayAuthentication:
			CConfig.s_cmManager.CheckGatewayAuthentication(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				);

			// Sign in:
			mdsFinal = _biz.CommonSignIn(
				strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strTid // strTid
				, strPartnerCode // strPartnerCode
				, strPartnerUserCode // strPartnerUserCode
				, strLanguageCode // strLanguageCode
				, strDealerCode // strDealerCode
				, strNickName // strNickName
				, strPassword // strPassword
				);
			if (CMyDataSet.HasError(mdsFinal)) return mdsFinal;

			// Clean ExpiredSessions:
			CConfig.s_cmManager.CleanSessionExpired();

			// Register new Session:
			string strUserCode = Convert.ToString(CMyDataSet.GetRemark(mdsFinal));
			string strSessionId = CConfig.s_cmManager.AddSession(
				strPartnerCode // strPartnerCode
				, strPartnerUserCode // strPartnerUserCode
				, strLanguageCode // strLanguageCode
				, strUserCode // strUserCode
				, strOtherInfo // strOtherInfo
				);
			CMyDataSet.SetRemark(ref mdsFinal, string.Format("{0}|{1}", strSessionId, strUserCode));
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				);
		}

		// Return Good:
		mdsFinal.AcceptChanges();
		return mdsFinal;
	}
    [WebMethod]
    public DataSet CommonGetMasterData(
            string strGwUserCode
            , string strGwPassword
            , string strTid
            , string strSessionId
            , string strTableName
            , object[] arrobjParamsCouple
        )
    {
        // Temp:
        string strFunctionName = "CommonGetMasterData";

        #region // Check:
        // Check Init:
        if (_mdsInitError != null) return _mdsInitError;
        string strErrorCodeDefault = TError.ErrHTC.CommonSessionPreInitFailed;
        DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
        ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
        string strPartnerCode = "";
        string strPartnerUserCode = "";
        string strLanguageCode = "";
        string strUserCode = "";

        try
        {
            // Check all:
            DataRow drSession = null;
            CConfig.s_cmManager.CheckAllCondition(
                ref alParamsCoupleError // alParamsCoupleError
                , strGwUserCode // strGwUserCode
                , strGwPassword // strGwPassword
                , strSessionId // strSessionId
                , out drSession // drSession
                );
            strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
            strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
            strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
            strUserCode = Convert.ToString(drSession["UserCode"]);
        }
        catch (Exception exc)
        {
            return TUtils.CProcessException.Process(
                ref mdsFinal // mdsFinal
                , exc // exc
                , strErrorCodeDefault // strErrorCode
                , alParamsCoupleError.ToArray() // arrobjErrorParams
                );
        }
        #endregion

        // Return Good:
        return TERP.Utils.CUtils.MyDSEncode(_biz.CommonGetMasterData(
            strGwUserCode
            , strGwPassword
            , strTid
            , strPartnerCode
            , strPartnerUserCode
            , strLanguageCode
            , strTableName
            , arrobjParamsCouple
            ));
    }

    [WebMethod]
    public DataSet CommonSaveMasterData(
            string strGwUserCode
            , string strGwPassword
            , string strTid
            , string strSessionId
            , string[] arrstrTableNamesCouple
            , DataSet dsData
        )
    {
        // Temp:
        string strFunctionName = "CommonSaveMasterData";

        #region // Check:
        // Check Init:
        if (_mdsInitError != null) return _mdsInitError;
        string strErrorCodeDefault = TError.ErrHTC.CommonSessionPreInitFailed;
        DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
        ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
        string strPartnerCode = "";
        string strPartnerUserCode = "";
        string strLanguageCode = "";
        string strUserCode = "";

        try
        {
            // Check all:
            DataRow drSession = null;
            CConfig.s_cmManager.CheckAllCondition(
                ref alParamsCoupleError // alParamsCoupleError
                , strGwUserCode // strGwUserCode
                , strGwPassword // strGwPassword
                , strSessionId // strSessionId
                , out drSession // drSession
                );
            strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
            strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
            strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
            strUserCode = Convert.ToString(drSession["UserCode"]);
        }
        catch (Exception exc)
        {
            return TUtils.CProcessException.Process(
                ref mdsFinal // mdsFinal
                , exc // exc
                , strErrorCodeDefault // strErrorCode
                , alParamsCoupleError.ToArray() // arrobjErrorParams
                );
        }
        #endregion

        // Return Good:
        return TERP.Utils.CUtils.MyDSEncode(_biz.CommonSaveMasterData(
            strGwUserCode
            , strGwPassword
            , strTid
            , strPartnerCode
            , strPartnerUserCode
            , strLanguageCode
            , arrstrTableNamesCouple
            , dsData
            ));
    }
    #endregion

    #region // System:
    [WebMethod]
	public DataSet Ser_SysGetCurentUser(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strSessionId
		)
	{
		// Temp:
		string strFunctionName = "Ser_SysGetCurentUser";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Ser_SysGetCurentUser(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			));
	}

	[WebMethod]
	public DataSet Ser_SysGetUser(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strSessionId
			, string strUserCodeList
			, string strUserNamePattern
			, string strFlagActiveListForUser
			, string strAreaCodeList
			, string strBUCodeList
			, string strBUCodePattern
			, string strFlagActiveListForDealer
			, string strGroupCodeList
		)
	{
		// Temp:
		string strFunctionName = "Ser_SysGetUser";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Ser_SysGetUser(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strUserCodeList
			, strUserNamePattern
			, strFlagActiveListForUser
			, strAreaCodeList
			, strBUCodeList
			, strBUCodePattern
			, strFlagActiveListForDealer
			, strGroupCodeList
			));
	}

	[WebMethod]
	public DataSet Ser_SysGetGroup(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strSessionId
			, string strGroupCodeList
			, string strGroupNamePattern
		)
	{
		// Temp:
		string strFunctionName = "Ser_SysGetGroup";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Ser_SysGetGroup(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strGroupCodeList
			, strGroupNamePattern
			));
	}

	[WebMethod]
	public DataSet Ser_SysGetMapSysGroupSysUser(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strSessionId
			, string strGroupCodeList
			, string strUserCodeList
			, string strFlagActiveListForUser
		)
	{
		// Temp:
		string strFunctionName = "Ser_SysGetMapSysGroupSysUser";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Ser_SysGetMapSysGroupSysUser(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strGroupCodeList
			, strUserCodeList
			, strFlagActiveListForUser
			));
	}

	[WebMethod]
	public DataSet Ser_SysGetPartner(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strSessionId
			, string strPartnerCodeList
			, string strDealerCodeList
		)
	{
		// Temp:
		string strFunctionName = "Ser_SysGetPartner";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Ser_SysGetPartner(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strPartnerCodeList
			, strDealerCodeList
			));
	}

	[WebMethod]
	public DataSet Ser_SysGetObjectType(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strSessionId
			, string strObjectTypeList
			, string strDealerCodeList
		)
	{
		// Temp:
		string strFunctionName = "Ser_SysGetObjectType";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Ser_SysGetObjectType(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strObjectTypeList
			, strDealerCodeList
			));
	}

	[WebMethod]
	public DataSet Ser_SysGetObject(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strSessionId
			, string strPartnerCodeList
			, string strObjectCodeList
			, string strFlagActiveList
		)
	{
		// Temp:
		string strFunctionName = "Ser_SysGetObject";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Ser_SysGetObject(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strPartnerCodeList
			, strObjectCodeList
			, strFlagActiveList
			));
	}

	[WebMethod]
	public DataSet Ser_SysGetMapSysGroupSysObject(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strSessionId
			, string strGroupCodeList
			, string strPartnerCodeList
			, string strObjectCodeList
			, string strObjectTypeList
			, string strFlagActiveListForObject
            //, string strDealerCodeList
		)
	{
		// Temp:
		string strFunctionName = "Ser_SysGetMapSysGroupSysObject";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Ser_SysGetMapSysGroupSysObject(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strGroupCodeList
			, strPartnerCodeList
			, strObjectCodeList
			, strObjectTypeList
			, strFlagActiveListForObject
            //, strDealerCodeList
			));
	}

	[WebMethod]
	public DataSet Ser_SysGetMapSysUserSysObjectForCurrentUser(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strSessionId
		)
	{
		// Temp:
		string strFunctionName = "Ser_SysGetMapSysUserSysObjectForCurrentUser";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Ser_SysGetMapSysUserSysObjectForCurrentUser(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			));
	}

	[WebMethod]
	public DataSet Ser_SysGetMapSysUserSysObject(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strSessionId
			, string strUserCodeList
			, string strUserNamePattern
			, string strFlagActiveListForUser
			, string strBUCodeList
			, string strBUCodePattern
			, string strFlagActiveListForDealer
			, string strGroupCodeList
			, string strPartnerCodeList
			, string strObjectCodeList
			, string strObjectTypeList
			, string strFlagActiveListForObject
		)
	{
		// Temp:
		string strFunctionName = "Ser_SysGetMapSysUserSysObject";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Ser_SysGetMapSysUserSysObject(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strUserCodeList
			, strUserNamePattern
			, strFlagActiveListForUser
			, strBUCodeList
			, strBUCodePattern
			, strFlagActiveListForDealer
			, strGroupCodeList
			, strPartnerCodeList
			, strObjectCodeList
			, strObjectTypeList
			, strFlagActiveListForObject
			));
	}

	[WebMethod]
	public DataSet Ser_SysResetUserPassword(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strSessionId
			, string strUserCodeReset
			, string strPasswordReset
		)
	{
		// Temp:
		string strFunctionName = "Ser_SysResetUserPassword";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Ser_SysResetUserPassword(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strUserCodeReset
			, strPasswordReset
			));
	}

	[WebMethod]
	public DataSet Ser_SysSaveUser(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strSessionId
			, DataSet ds_Sys_User
		)
	{
		// Temp:
		string strFunctionName = "Ser_SysSaveUser";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Ser_SysSaveUser(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, ds_Sys_User
			));
	}

	[WebMethod]
	public DataSet Ser_SysSaveGroup(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strSessionId
            , string strGroupCodeListForDelete
			, DataSet ds_Sys_Group
		)
	{
		// Temp:
		string strFunctionName = "Ser_SysSaveGroup";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Ser_SysSaveGroup(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
            , strGroupCodeListForDelete
			, ds_Sys_Group
			));
	}

	[WebMethod]
	public DataSet Ser_SysSaveMapSysGroupSysUser(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strSessionId
			, string strGroupCodeList
            , DataSet ds_MapGroupUser

		)
	{
		// Temp:
		string strFunctionName = "Ser_SysSaveMapSysGroupSysUser";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Ser_SysSaveMapSysGroupSysUser(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strGroupCodeList
            , ds_MapGroupUser
			));
	}

	[WebMethod]
	public DataSet Ser_SysSaveMapSysGroupSysObject(
			string strGWUserCode
			, string strGWPassword
			, string strTid
			, string strSessionId
			, string strGroupCodeList
            , DataSet ds_MapGroupObject
		)
	{
		// Temp:
		string strFunctionName = "Ser_SysSaveMapSysGroupSysObject";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Ser_SysSaveMapSysGroupSysObject(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strGroupCodeList
            , ds_MapGroupObject
			));
	}

	#endregion  	

    #region //Master 
    #region Office
    [WebMethod]
    public DataSet Its_Office_Get(
           string strGWUserCode
           , string strGWPassword
           , string strTid
           , string strSessionId
           , string strOfficeCodeList
           , string strOfficeNamePattern
           , string strOfficceAddressPattern
           )
    {
        // Temp:
        string strFunctionName = "Its_Office_Get";

        #region // Check:
        // Check Init:
        if (_mdsInitError != null) return _mdsInitError;
        string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
        DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
        ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
        string strPartnerCode = "";
        string strPartnerUserCode = "";
        string strLanguageCode = "";
        string strUserCode = "";

        try
        {
            // Check all:
            DataRow drSession = null;
            CConfig.s_cmManager.CheckAllCondition(
                ref alParamsCoupleError // alParamsCoupleError
                , strGWUserCode // strGWUserCode
                , strGWPassword // strGWPassword
                , strSessionId // strSessionId
                , out drSession // drSession
                );
            strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
            strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
            strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
            strUserCode = Convert.ToString(drSession["UserCode"]);
        }
        catch (Exception exc)
        {
            return TUtils.CProcessException.Process(
                ref mdsFinal // mdsFinal
                , exc // exc
                , strErrorCodeDefault // strErrorCode
                , alParamsCoupleError.ToArray() // arrobjErrorParams
                );
        }
        #endregion

        // Return Good:
        return TERP.Utils.CUtils.MyDSEncode(_biz.Its_Office_Get(
            strGWUserCode
            , strGWPassword
            , strTid
            , strPartnerCode
            , strPartnerUserCode
            , strLanguageCode
            ,strOfficeCodeList
            ,strOfficeNamePattern
            ,strOfficceAddressPattern
            ));
    }

    [WebMethod]
    public DataSet Its_Office_Create(
    string strGWUserCode
    , string strGWPassword
    , string strTid
    , string strSessionId
    , string strOfficeCode
    , string strOfficeName
    , string strAddress
    , string strTel
    , string strMobile
    , string strFax
    , string strEmail
    , string strWebsite
    , string strNote
    )
    {
        // Temp:
        string strFunctionName = "Its_Office_Create";

        #region // Check:
        // Check Init:
        if (_mdsInitError != null) return _mdsInitError;
        string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
        DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
        ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
        string strPartnerCode = "";
        string strPartnerUserCode = "";
        string strLanguageCode = "";
        string strUserCode = "";

        try
        {
            // Check all:
            DataRow drSession = null;
            CConfig.s_cmManager.CheckAllCondition(
                ref alParamsCoupleError // alParamsCoupleError
                , strGWUserCode // strGWUserCode
                , strGWPassword // strGWPassword
                , strSessionId // strSessionId
                , out drSession // drSession
                );
            strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
            strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
            strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
            strUserCode = Convert.ToString(drSession["UserCode"]);
        }
        catch (Exception exc)
        {
            return TUtils.CProcessException.Process(
                ref mdsFinal // mdsFinal
                , exc // exc
                , strErrorCodeDefault // strErrorCode
                , alParamsCoupleError.ToArray() // arrobjErrorParams
                );
        }
        #endregion

        // Return Good:
        return TERP.Utils.CUtils.MyDSEncode(_biz.Its_Office_Create(
            strGWUserCode
            , strGWPassword
            , strTid
            , strPartnerCode
            , strPartnerUserCode
            , strLanguageCode
            , strOfficeCode
            , strOfficeName
            , strAddress
            ,strTel
            ,strMobile
            ,strFax
            ,strEmail
            ,strWebsite
            ,strNote
            ));
    }
    #endregion

	#region //WaterCustomer
	#region //Its_WaterCustomer_Get
	[WebMethod]
	public DataSet Its_WaterCustomer_Get(
           string strGWUserCode
           , string strGWPassword
           , string strTid
           , string strSessionId
			 , string strCusIDConditionList
		, string strCusCodeConditionList
		, string strCusNameConditionList
		, string strOrgNameConditionList
		, string strAddressConditionList
           )
    {
        // Temp:
		string strFunctionName = "Its_WaterCustomer_Get";

        #region // Check:
        // Check Init:
        if (_mdsInitError != null) return _mdsInitError;
        string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
        DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
        ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
        string strPartnerCode = "";
        string strPartnerUserCode = "";
        string strLanguageCode = "";
        string strUserCode = "";

        try
        {
            // Check all:
            DataRow drSession = null;
            CConfig.s_cmManager.CheckAllCondition(
                ref alParamsCoupleError // alParamsCoupleError
                , strGWUserCode // strGWUserCode
                , strGWPassword // strGWPassword
                , strSessionId // strSessionId
                , out drSession // drSession
                );
            strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
            strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
            strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
            strUserCode = Convert.ToString(drSession["UserCode"]);
        }
        catch (Exception exc)
        {
            return TUtils.CProcessException.Process(
                ref mdsFinal // mdsFinal
                , exc // exc
                , strErrorCodeDefault // strErrorCode
                , alParamsCoupleError.ToArray() // arrobjErrorParams
                );
        }
        #endregion

        // Return Good:
        return TERP.Utils.CUtils.MyDSEncode(_biz.Its_WaterCustomer_Get(
            strGWUserCode
            , strGWPassword
            , strTid
            , strPartnerCode
            , strPartnerUserCode
            , strLanguageCode
             ,  strCusIDConditionList
				,  strCusCodeConditionList
				,  strCusNameConditionList
				,  strOrgNameConditionList
				,  strAddressConditionList
            ));
    }
    #endregion

    #region //Its_GuideSupplier_Create
    [WebMethod]
	public DataSet Its_Water_Customer_Create(
           string strGWUserCode
           , string strGWPassword
           , string strTid
           , string strSessionId
			, string strCusCode
			 , string strCusName
			 , string strOrgName
			 , string strAddress
			 , string strCusTel
			 , string strDebit
			 , string strNote
			 , string strNoVoCurrent
			 , string strCuocVoCurrent
           )
    {
        // Temp:
		string strFunctionName = "Its_Water_Customer_Create";

        #region // Check:
        // Check Init:
        if (_mdsInitError != null) return _mdsInitError;
        string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
        DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
        ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
        string strPartnerCode = "";
        string strPartnerUserCode = "";
        string strLanguageCode = "";
        string strUserCode = "";

        try
        {
            // Check all:
            DataRow drSession = null;
            CConfig.s_cmManager.CheckAllCondition(
                ref alParamsCoupleError // alParamsCoupleError
                , strGWUserCode // strGWUserCode
                , strGWPassword // strGWPassword
                , strSessionId // strSessionId
                , out drSession // drSession
                );
            strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
            strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
            strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
            strUserCode = Convert.ToString(drSession["UserCode"]);
        }
        catch (Exception exc)
        {
            return TUtils.CProcessException.Process(
                ref mdsFinal // mdsFinal
                , exc // exc
                , strErrorCodeDefault // strErrorCode
                , alParamsCoupleError.ToArray() // arrobjErrorParams
                );
        }
        #endregion

        // Return Good:
        return TERP.Utils.CUtils.MyDSEncode(_biz.Its_Water_Customer_Create(
            strGWUserCode
            , strGWPassword
            , strTid
            , strPartnerCode
            , strPartnerUserCode
            , strLanguageCode
            ,  strCusCode
			 ,  strCusName
			 ,  strOrgName
			 ,  strAddress
			 ,  strCusTel
			 ,  strDebit
			 ,  strNote
			 ,  strNoVoCurrent
			 ,  strCuocVoCurrent
            ));
    }
    #endregion

	#region //Its_Water_Customer_Update
	[WebMethod]
	public DataSet Its_Water_Customer_Update(
           string strGWUserCode
           , string strGWPassword
           , string strTid
           , string strSessionId
		   , string strCusID
			, string strCusCode
			 , string strCusName
			 , string strOrgName
			 , string strAddress
			 , string strCusTel
			 , string strDebit
			 , string strNote
			 , string strNoVoCurrent
			 , string strCuocVoCurrent
           )
    {
        // Temp:
		string strFunctionName = "Its_Water_Customer_Update";

        #region // Check:
        // Check Init:
        if (_mdsInitError != null) return _mdsInitError;
        string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
        DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
        ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
        string strPartnerCode = "";
        string strPartnerUserCode = "";
        string strLanguageCode = "";
        string strUserCode = "";

        try
        {
            // Check all:
            DataRow drSession = null;
            CConfig.s_cmManager.CheckAllCondition(
                ref alParamsCoupleError // alParamsCoupleError
                , strGWUserCode // strGWUserCode
                , strGWPassword // strGWPassword
                , strSessionId // strSessionId
                , out drSession // drSession
                );
            strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
            strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
            strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
            strUserCode = Convert.ToString(drSession["UserCode"]);
        }
        catch (Exception exc)
        {
            return TUtils.CProcessException.Process(
                ref mdsFinal // mdsFinal
                , exc // exc
                , strErrorCodeDefault // strErrorCode
                , alParamsCoupleError.ToArray() // arrobjErrorParams
                );
        }
        #endregion

        // Return Good:
        return TERP.Utils.CUtils.MyDSEncode(_biz.Its_Water_Customer_Update(
            strGWUserCode
            , strGWPassword
            , strTid
            , strPartnerCode
            , strPartnerUserCode
            , strLanguageCode
			,  strCusID
			,  strCusCode
			 ,  strCusName
			 ,  strOrgName
			 ,  strAddress
			 ,  strCusTel
			 ,  strDebit
			 ,  strNote
			 ,  strNoVoCurrent
			 ,  strCuocVoCurrent
            ));
    }
    #endregion

	#region //Its_Water_Customer_Delete
	[WebMethod]
	public DataSet Its_Water_Customer_Delete(
           string strGWUserCode
           , string strGWPassword
           , string strTid
           , string strSessionId
        , string strCusID
           )
    {
        // Temp:
		string strFunctionName = "Its_Water_Customer_Delete";

        #region // Check:
        // Check Init:
        if (_mdsInitError != null) return _mdsInitError;
        string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
        DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
        ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
        string strPartnerCode = "";
        string strPartnerUserCode = "";
        string strLanguageCode = "";
        string strUserCode = "";

        try
        {
            // Check all:
            DataRow drSession = null;
            CConfig.s_cmManager.CheckAllCondition(
                ref alParamsCoupleError // alParamsCoupleError
                , strGWUserCode // strGWUserCode
                , strGWPassword // strGWPassword
                , strSessionId // strSessionId
                , out drSession // drSession
                );
            strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
            strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
            strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
            strUserCode = Convert.ToString(drSession["UserCode"]);
        }
        catch (Exception exc)
        {
            return TUtils.CProcessException.Process(
                ref mdsFinal // mdsFinal
                , exc // exc
                , strErrorCodeDefault // strErrorCode
                , alParamsCoupleError.ToArray() // arrobjErrorParams
                );
        }
        #endregion

        // Return Good:
        return TERP.Utils.CUtils.MyDSEncode(_biz.Its_Water_Customer_Delete(
            strGWUserCode
            , strGWPassword
            , strTid
            , strPartnerCode
            , strPartnerUserCode
            , strLanguageCode
		   , strCusID
            ));
    }
    #endregion

    #endregion



	#region //Water Price

	#region //Its_Price_Get
	[WebMethod]
	public DataSet Its_Price_Get(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
			, string strUnitCode
		   )
	{
		// Temp:
		string strFunctionName = "Its_Price_Get";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_Price_Get(
				strGWUserCode
				, strGWPassword
				, strTid
				, strPartnerCode
				, strPartnerUserCode
				, strLanguageCode
				, strUnitCode
			));
	}
	#endregion

	#region //Its_StockOut_Update
	[WebMethod]
	public DataSet Its_Price_Update(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
			, string strUnitCode
			 , string strDVTinh
			 , string strPrice
			 , string strDateUpdate
		   )
	{
		// Temp:
		string strFunctionName = "Its_Price_Update";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_Price_Update(
				strGWUserCode
				, strGWPassword
				, strTid
				, strPartnerCode
				, strPartnerUserCode
				, strLanguageCode
				,  strUnitCode
				 ,  strDVTinh
				 ,  strPrice
				 ,  strDateUpdate
			));
	}
	#endregion

	#endregion

	#region //Receipt
	#region //Its_Receipt_Get
	[WebMethod]
	public DataSet Its_Receipt_Get(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
			, string strReceiptIDConditionList
			, string strDateReceiptConditionList
			, string strCusIDConditionList
		   )
	{
		// Temp:
		string strFunctionName = "Its_Receipt_Get";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_Receipt_Get(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			,strReceiptIDConditionList
			, strDateReceiptConditionList
			, strCusIDConditionList
			));
	}
	#endregion

	#region //Its_Receipt_Create
	[WebMethod]
	public DataSet Its_Receipt_Create(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
			, string strReceiptCode
			 , string strDateReceipt
			 , string strNote
			 , string strCusID
			 , string strAmount
			 , string strReceiptType
		   )
	{
		// Temp:
		string strFunctionName = "Its_Receipt_Create";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_Receipt_Create(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			,  strReceiptCode
			 ,  strDateReceipt
			 ,  strNote
			 ,  strCusID
			 ,  strAmount
			 ,  strReceiptType
			));
	}
	#endregion

	#region //Its_Receipt_Update
	[WebMethod]
	public DataSet Its_Receipt_Update(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
			 , string strReceiptID
			 , string strReceiptCode
			 , string strDateReceipt
			 , string strNote
			 , string strCusID
			 , string strAmount
			 , string strReceiptType
		   )
	{
		// Temp:
		string strFunctionName = "Its_Receipt_Update";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_Receipt_Update(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			 ,  strReceiptID
			 ,  strReceiptCode
			 ,  strDateReceipt
			 ,  strNote
			 ,  strCusID
			 ,  strAmount
			 ,  strReceiptType
			));
	}
	#endregion

	#region //Its_Receipt_Delete
	[WebMethod]
	public DataSet Its_Receipt_Delete(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
		   , string strReceiptID
		   )
	{
		// Temp:
		string strFunctionName = "Its_Receipt_Delete";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_Receipt_Delete(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strReceiptID
			));
	}
	#endregion

	#endregion

	#region //Supplier
	#region // SerSupplierCreate
	[WebMethod]
	public DataSet SerSupplierCreate(
		string strGwUserCode
		, string strGwPassword
		, string strTid
		, string strSessionId
		, string strSupplierCode
		, string strSupplierName
		, string strSupplierPhone
		, string strSupplierFax
		, string strContactName
		, string strContactPhone
		, string strAddress
		, string strIsActive
	)
	{
		string strFunctionName = "SerSupplierCreate";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGwUserCode // strGwUserCode
				, strGwPassword // strGwPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		return TERP.Utils.CUtils.MyDSEncode(_biz.SerSupplierCreate(
			 strGwUserCode
			, strGwPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strSupplierCode
			, strSupplierName
			, strSupplierPhone
			, strSupplierFax
			, strContactName
			, strContactPhone
			, strAddress
			, strIsActive
		  ));

	}
	#endregion

	#region // SerSupplierUpdate
	[WebMethod]
	public DataSet SerSupplierUpdate(
		string strGwUserCode
		, string strGwPassword
		, string strTid
		, string strSessionId
		, string strSupplierID
		, string strSupplierCode
		, string strSupplierName
		, string strSupplierPhone
		, string strSupplierFax
		, string strContactName
		, string strContactPhone
		, string strAddress
		, string strIsActive
	)
	{
		string strFunctionName = "SerSupplierUpdate";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGwUserCode // strGwUserCode
				, strGwPassword // strGwPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion


		return TERP.Utils.CUtils.MyDSEncode(_biz.SerSupplierUpdate(
			 strGwUserCode
			, strGwPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strSupplierID
			, strSupplierCode
			, strSupplierName
			, strSupplierPhone
			, strSupplierFax
			, strContactName
			, strContactPhone
			, strAddress
			, strIsActive
		));
	}
	#endregion

	#region // SerSupplierGet
	[WebMethod]
	public DataSet SerSupplierGet(
		string strGwUserCode
		, string strGwPassword
		, string strTid
		, string strSessionId
		, string strSupplierIDConditionList
		, string strSupplierCodeConditionList
		, string strSupplierNameConditionList
		, string strAddressConditionList
		, string strIsActiveConditionList
	)
	{
		string strFunctionName = "SerSupplierGet";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGwUserCode // strGwUserCode
				, strGwPassword // strGwPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion
		return TERP.Utils.CUtils.MyDSEncode(_biz.SerSupplierGet(
			 strGwUserCode
			, strGwPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strSupplierIDConditionList
			, strSupplierCodeConditionList
			, strSupplierNameConditionList
			, strAddressConditionList
			, strIsActiveConditionList
		));

	}
	#endregion

	#region // SerSupplierGetForCode
	[WebMethod]
	public DataSet SerSupplierGetForCode(
		string strGwUserCode
		, string strGwPassword
		, string strTid
		, string strSessionId
		, string strIsActiveConditionList
	)
	{
		string strFunctionName = "SerSupplierGetForCode";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGwUserCode // strGwUserCode
				, strGwPassword // strGwPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion
		return TERP.Utils.CUtils.MyDSEncode(_biz.SerSupplierGetForCode(
			 strGwUserCode
			, strGwPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strIsActiveConditionList
		));

	}
	#endregion
	#endregion


	#region //WaterHangHoa
	#region //Its_WaterHangHoa_Get
	[WebMethod]
	public DataSet Its_WaterHangHoa_Get(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
			, string strMahangConditionList
			, string strTenHangConditionList
		   )
	{
		// Temp:
		string strFunctionName = "Its_WaterHangHoa_Get";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_WaterHangHoa_Get(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			 , strMahangConditionList
				, strTenHangConditionList

			));
	}
	#endregion

	#region //Its_Water_HangHoa_Create
	[WebMethod]
	public DataSet Its_Water_HangHoa_Create(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
			, string strMahang
			 , string strTenHang
			 , string strQuantity
			 , string strUnit
			 , string strPrice
			 , string strCost
			 , string strNote
		   )
	{
		// Temp:
		string strFunctionName = "Its_Water_HangHoa_Create";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_Water_HangHoa_Create(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			,  strMahang
			 ,  strTenHang
			 ,  strQuantity
			 ,  strUnit
			 ,  strPrice
			 ,  strCost
			 ,  strNote
			));
	}
	#endregion

	#region //Its_Water_HangHoa_Update
	[WebMethod]
	public DataSet Its_Water_HangHoa_Update(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
			, string strMahang
			 , string strTenHang
			 , string strQuantity
			 , string strUnit
			 , string strPrice
			 , string strCost
			 , string strNote
		   )
	{
		// Temp:
		string strFunctionName = "Its_Water_HangHoa_Update";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_Water_HangHoa_Update(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strMahang
			 , strTenHang
			 , strQuantity
			 , strUnit
			 , strPrice
			 , strCost
			 , strNote
			));
	}
	#endregion

	#region //Its_Water_HangHoa_Delete
	[WebMethod]
	public DataSet Its_Water_HangHoa_Delete(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
		, string strMahang
		   )
	{
		// Temp:
		string strFunctionName = "Its_Water_HangHoa_Delete";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_Water_HangHoa_Delete(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
		   , strMahang
			));
	}
	#endregion

	#endregion


	#endregion //Master

	#region //StockOut
	#region //Its_StockOut_Get
	[WebMethod]
	public DataSet Its_StockOut_Get(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
			, string strStockIDConditionList
			, string strStockOutDateConditionList
			, string strUnitConditionList
			, string strCusIDConditionList
			, string strCusNameConditionList
			, string strStatusConditionList
		   )
	{
		// Temp:
		string strFunctionName = "Its_StockOut_Get";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_StockOut_Get(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strStockIDConditionList
			, strStockOutDateConditionList
			, strUnitConditionList
			, strCusIDConditionList
			, strCusNameConditionList
			, strStatusConditionList
			));
	}
	#endregion

	#region //Its_StockOut_Get_Rpt
	[WebMethod]
	public DataSet Its_StockOut_Get_Rpt(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
			, string strStockIDConditionList
			, string strStockOutDateConditionList
			, string strUnitConditionList
			, string strCusIDConditionList
			, string strCusNameConditionList
		   )
	{
		// Temp:
		string strFunctionName = "Its_StockOut_Get_Rpt";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_StockOut_Get_Rpt(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strStockIDConditionList
			, strStockOutDateConditionList
			, strUnitConditionList
			, strCusIDConditionList
			, strCusNameConditionList
			));
	}
	#endregion

	#region //Its_StockOut_Create
	[WebMethod]
	public DataSet Its_StockOut_Create(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
			, string strStockOutCode
			 , string strStockOutDate
			 , string strNote
			 , string strQuantity
			 , string strPrice
			 , string strPriceCuocVo
			 , string strUnit
			 , string strNoVo
			 , string strCuocVo
			 , string strCusID
			 , string strStatus
			 , string strAmountPaid
		   )
	{
		// Temp:
		string strFunctionName = "Its_StockOut_Create";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_StockOut_Create(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strStockOutCode
			 , strStockOutDate
			 , strNote
			 , strQuantity
			 , strPrice
			 , strPriceCuocVo
			 , strUnit
			 , strNoVo
			 , strCuocVo
			 , strCusID
			 , strStatus
			 , strAmountPaid
			));
	}
	#endregion

	#region //Its_StockOut_Update
	[WebMethod]
	public DataSet Its_StockOut_Update(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
			, string strStockOutID
			, string strStockOutCode
			 , string strStockOutDate
			 , string strNote
			 , string strQuantity
			 , string strPrice
			 , string strPriceCuocVo
			 , string strUnit
			 , string strNoVo
			 , string strCuocVo
			 , string strCusID
			 , string strStatus
			 , string strAmountPaid
		   )
	{
		// Temp:
		string strFunctionName = "Its_StockOut_Update";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_StockOut_Update(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strStockOutID
			, strStockOutCode
			 , strStockOutDate
			 , strNote
			 , strQuantity
			 , strPrice
			 , strPriceCuocVo
			 , strUnit
			 , strNoVo
			 , strCuocVo
			 , strCusID
			 , strStatus
			 , strAmountPaid
			));
	}
	#endregion

	#region //Its_StockOut_Delete
	[WebMethod]
	public DataSet Its_StockOut_Delete(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
		   , string strStockOutID
		   )
	{
		// Temp:
		string strFunctionName = "Its_StockOut_Delete";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_StockOut_Delete(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strStockOutID
			));
	}
	#endregion

	#endregion

	#region //StockIn
	#region //Its_StockIn_Get
	[WebMethod]
	public DataSet Its_StockIn_Get(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
			, string strStockIDConditionList
			, string strStockInDateConditionList
			, string strSupplierIDConditionList
		   )
	{
		// Temp:
		string strFunctionName = "Its_StockIn_Get";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_StockIn_Get(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strStockIDConditionList
			, strStockInDateConditionList
			, strSupplierIDConditionList
			));
	}
	#endregion

	#region //Its_StockIn_Create
	[WebMethod]
	public DataSet Its_StockIn_Create(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
			, string strStockInCode
			 , string strStockInDate
			 , string strNote
			 , string strSupplierID
			 , DataSet dsStockInDetail
		   )
	{
		// Temp:
		string strFunctionName = "Its_StockIn_Create";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_StockIn_Create(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strStockInCode
			 , strStockInDate
			 , strNote
			 , strSupplierID
			, dsStockInDetail
			));
	}
	#endregion

	#region //Its_StockIn_Update
	[WebMethod]
	public DataSet Its_StockIn_Update(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
			, string strStockInID
			, string strStockInCode
			 , string strStockInDate
			 , string strNote
			 , string strSupplierID
			, DataSet dsStockInDetail
		   )
	{
		// Temp:
		string strFunctionName = "Its_StockIn_Update";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_StockIn_Update(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strStockInID
			, strStockInCode
			 , strStockInDate
			 , strNote
			 , strSupplierID
			 , dsStockInDetail
			));
	}
	#endregion

	#region //Its_StockIn_Delete
	[WebMethod]
	public DataSet Its_StockIn_Delete(
		   string strGWUserCode
		   , string strGWPassword
		   , string strTid
		   , string strSessionId
		   , string strStockInID
		   )
	{
		// Temp:
		string strFunctionName = "Its_StockIn_Delete";

		#region // Check:
		// Check Init:
		if (_mdsInitError != null) return _mdsInitError;
		string strErrorCodeDefault = TError.ErrITS.CommonSessionPreInitFailed;
		DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
		ArrayList alParamsCoupleError = new ArrayList(new object[]{
			"strFunctionName", strFunctionName
			});
		string strPartnerCode = "";
		string strPartnerUserCode = "";
		string strLanguageCode = "";
		string strUserCode = "";

		try
		{
			// Check all:
			DataRow drSession = null;
			CConfig.s_cmManager.CheckAllCondition(
				ref alParamsCoupleError // alParamsCoupleError
				, strGWUserCode // strGWUserCode
				, strGWPassword // strGWPassword
				, strSessionId // strSessionId
				, out drSession // drSession
				);
			strPartnerCode = Convert.ToString(drSession["PartnerCode"]);
			strPartnerUserCode = Convert.ToString(drSession["PartnerUserCode"]);
			strLanguageCode = Convert.ToString(drSession["LanguageCode"]);
			strUserCode = Convert.ToString(drSession["UserCode"]);
		}
		catch (Exception exc)
		{
			return TUtils.CProcessException.Process(
				ref mdsFinal // mdsFinal
				, exc // exc
				, strErrorCodeDefault // strErrorCode
				, alParamsCoupleError.ToArray() // arrobjErrorParams
				);
		}
		#endregion

		// Return Good:
		return TERP.Utils.CUtils.MyDSEncode(_biz.Its_StockIn_Delete(
			strGWUserCode
			, strGWPassword
			, strTid
			, strPartnerCode
			, strPartnerUserCode
			, strLanguageCode
			, strStockInID
			));
	}
	#endregion

	#endregion
}

internal class CConfig
{
	#region // Constructors and Destructors:
	public static TUtils.CConnectionManager s_cmManager = null;
	static CConfig()
	{
		// Init CConnectionManager:
		s_cmManager = new TUtils.CConnectionManager(
			Convert.ToInt32(ConfigurationManager.AppSettings["_strConfig_SessionTimeoutMilliseconds"]) // nSessionTimeOut
			, Convert.ToString(ConfigurationManager.AppSettings["_strConfig_GWUserCode_CarSv"]) // strConfig_GWUserCode
			, Convert.ToString(ConfigurationManager.AppSettings["_strConfig_GWUserPassword_CarSv"]) // strConfig_GWPassword
			, TError.ErrITS.CommonGatewayAuthenticateFailed // strErrCodeWhenGatewayAuthenticateFailed
			, TError.ErrITS.CommonSessionNotFound // strErrCodeWhenSessionNotFound
			, TError.ErrITS.CommonSessionExpired // strErrCodeWhenSessionExpired
			);
	}
	#endregion
}
